const express = require('express')
const app = express()

app.use((request, response, next) => {
  console.log('有人请求服务器1了')
  next()
})

app.get('/students', (request, response) => {
  const students = [
    {
      id: '001',
      name: 'lqj',
      age: 18
    },
    {
      id: '002',
      name: 'tjc',
      age: 18
    }
  ]
  response.send(students)
})

app.listen(5000, err => {
  if(!err) console.log('服务器1启动成功了，请求地址为： http://localhost:5000/students')
})
